package com.weigj.model;

import com.jfinal.plugin.activerecord.Model;

public class HourContractBackSett extends Model<HourContractBackSett> {
	public static final HourContractBackSett dao = new HourContractBackSett();

	public HourContractBackSett findOneByContractId(String hourContractId)
	{
		HourContractBackSett hcb = new HourContractBackSett();
		HourContract hc = HourContract.dao.findById(hourContractId);
		if (hc.getBigDecimal("BACKSETT_ID") == null)
		{
			return null;
		}
		hcb = dao.findById(hc.getBigDecimal("BACKSETT_ID"));
		return hcb;
	}
	
	/**根据结算单id查找 结算单信息
	 * @param hourContractId
	 * @return 结算单
	 */
	public HourContractBackSett findBackSett(String settId)
	{
		HourContractBackSett hcb = null;
		String sql ="select * from APP_HOURCONTRACTBACKSETT t where t.id=?";
		hcb = dao.findFirst(sql,settId);
		return hcb;
	}
}
